package com.puyuba.puyuba.view.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.puyuba.puyuba.R;
import com.puyuba.puyuba.bean.FindPriListBean;
import com.puyuba.puyuba.bean.SimpleMap;
import com.pyb.java.commonutil.utils.DateUtils;
import com.pyb.java.commonutil.utils.MapUtils;

public class FindPrivateAdatper extends BaseQuickAdapter<FindPriListBean.DataBean,BaseViewHolder> {
    //1.私有库  2.成交库 3 二开库
    private String type;
    public FindPrivateAdatper(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, FindPriListBean.DataBean item) {
        helper.addOnClickListener(R.id.tv_user_info);
        helper.addOnClickListener(R.id.tv_contact_users);
        helper.setText(R.id.tv_user_pro,"需求意向："+ MapUtils.getKeyByValue(SimpleMap.getInstance().getCareerNeedMap(),item.getEdulevelid()));
        helper.setText(R.id.tv_user_edu,"当前学历："+MapUtils.getKeyByValue(SimpleMap.getInstance().getEduNeedMap(),item.getSize()));
        helper.setText(R.id.tv_user_name,item.getName());
        helper.setText(R.id.tv_time,DateUtils.fromLongToDate("yyyy-MM-dd", item.getGetdatetime()*1000));

        if (item.getLevel().equals("A")){
            helper.itemView.findViewById(R.id.iv_level).setBackgroundResource(R.mipmap.icon_a);
        }else if (item.getLevel().equals("B")){
            helper.itemView.findViewById(R.id.iv_level).setBackgroundResource(R.mipmap.icon_b);
        }else if (item.getLevel().equals("C")){
            helper.itemView.findViewById(R.id.iv_level).setBackgroundResource(R.mipmap.icon_c);
        }else if (item.getLevel().equals("D")){
            helper.itemView.findViewById(R.id.iv_level).setBackgroundResource(R.mipmap.icon_d);
        }else{
            helper.itemView.findViewById(R.id.iv_level).setBackgroundResource(0);
        }

    }

    public void setType(String type) {
        this.type = type;
    }


}
